<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: PDFWorker</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: PDFWorker</h1>

    




<section>

<header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>
            <span class="ancestors"><a href="module-pdfjsLib.html">pdfjsLib</a>~</span>PDFWorker<span class="signature">(params)</span><span class="type-signature"></span></h2>
        
            <div class="class-description">PDF.js web worker abstraction that controls the instantiation of PDF
documents. Message handlers are used to pass information from the main
thread to the worker thread and vice versa. If the creation of a web
worker is not possible, a "fake" worker will be used instead.</div>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    
    <h2>Constructor</h2>
    

    
    <h4 class="name" id="PDFWorker"><span class="type-signature"></span>new PDFWorker<span class="signature">(params)</span><span class="type-signature"></span></h4>
    

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>params</code></td>
            

            <td class="type">
            
                
<span class="param-type">PDFWorkerParameters</span>


            
            </td>

            

            

            <td class="description last">The worker initialization parameters.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="api.js.html">api.js</a>, <a href="api.js.html#line1952">line 1952</a>
    </li></ul></dd>
    

    

    

    
</dl>




















    
    </div>

    

    

    

    

    

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<h4 class="name" id=".workerSrc"><span class="type-signature">(static) </span>workerSrc<span class="type-signature"> :string</span></h4>




<div class="description">
    The current `workerSrc`, when it exists.
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">string</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="api.js.html">api.js</a>, <a href="api.js.html#line2196">line 2196</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="messageHandler"><span class="type-signature"></span>messageHandler<span class="type-signature"> :MessageHandler</span></h4>




<div class="description">
    The current MessageHandler-instance.
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">MessageHandler</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="api.js.html">api.js</a>, <a href="api.js.html#line2001">line 2001</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="port"><span class="type-signature"></span>port<span class="type-signature"> :Worker</span></h4>




<div class="description">
    The current `workerPort`, when it exists.
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Worker</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="api.js.html">api.js</a>, <a href="api.js.html#line1993">line 1993</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="promise"><span class="type-signature"></span>promise<span class="type-signature"> :Promise:<a href="module-pdfjsLib-PDFObjects.html"></a>.&lt;void:<a href="module-pdfjsLib-PDFObjects.html"></a>></span></h4>




<div class="description">
    Promise for worker initialization completion.
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Promise:<a href="module-pdfjsLib-PDFObjects.html"></a>.&lt;void:<a href="module-pdfjsLib-PDFObjects.html"></a>></span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="api.js.html">api.js</a>, <a href="api.js.html#line1985">line 1985</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id=".fromPort"><span class="type-signature">(static) </span>fromPort<span class="signature">(params)</span><span class="type-signature"></span></h4>
    

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>params</code></td>
            

            <td class="type">
            
                
<span class="param-type">PDFWorkerParameters</span>


            
            </td>

            

            

            <td class="description last">The worker initialization parameters.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="api.js.html">api.js</a>, <a href="api.js.html#line2182">line 2182</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
            

    

    
    <h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    Destroys the worker instance.
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="api.js.html">api.js</a>, <a href="api.js.html#line2164">line 2164</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-pdfjsLib.html">pdfjsLib</a></li></ul><h3>Classes</h3><ul><li><a href="module-pdfjsLib-PDFDataRangeTransport.html">PDFDataRangeTransport</a></li><li><a href="module-pdfjsLib-PDFDocumentLoadingTask.html">PDFDocumentLoadingTask</a></li><li><a href="module-pdfjsLib-PDFDocumentProxy.html">PDFDocumentProxy</a></li><li><a href="module-pdfjsLib-PDFObjects.html">PDFObjects</a></li><li><a href="module-pdfjsLib-PDFPageProxy.html">PDFPageProxy</a></li><li><a href="module-pdfjsLib-PDFWorker.html">PDFWorker</a></li><li><a href="module-pdfjsLib-RenderTask.html">RenderTask</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Wed Sep 07 2022 09:51:16 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>